package com.olap.starter.config.dataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;


@Component
public class JdbcTemplateSource {

    @Autowired
    private DataSourceConfig dataSourceConfig;

    public JdbcTemplate getJdbcTemplate(String dbName) {
        return dataSourceConfig.getJdbcTemplate(dbName);
    }

    public JdbcTemplate getJdbcTemplateByDbName(String dbName) {
        return dataSourceConfig.getJdbcTemplate(dbName);
    }

    public JdbcTemplate getNewJdbcTemplateMap(String dbName) {
        return dataSourceConfig.getJdbcTemplate(dbName);
    }

    public void refreshDataSource() {
        dataSourceConfig.refreshDataSource();
    }
}
